package indi.woniu.service.impl;

import indi.woniu.entity.Condition;
import indi.woniu.entity.FormInline;
import indi.woniu.entity.Question;
import indi.woniu.mapper.QuestionDao;
import indi.woniu.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class QuestionServiceImpl implements QuestionService {
    @Autowired(required = false)
    private QuestionDao questionDao;
    @Override
    public List<Question> findAll(FormInline formInline) {
        List<Question> questionList = questionDao.findAll(formInline);
        return questionList;
    }

    @Override
    public List<Map<String,Object>> findByCondition(Condition condition) {
        List<Map<String,Object>> questions = questionDao.findAllByCondition(condition);
        return questions;
    }

    @Override
    public List findQuestionType() {
        List questionType =questionDao.findQuestionType();
        return questionType;
    }

    @Override
    public List findQuestionLevel() {
        List<Integer> level = questionDao.findQuestionLevel();
        return  level;
    }
}
